# Clear out all vpaths, then set just one (default vpath) for the main build
# directory.
vpath
vpath % .

# Clear the default suffixes, so that built-in rules are not used.
.SUFFIXES :

#
# Standard definitions.
#

SHELL := /bin/sh
CC := @CC@
LD := @LD@
AR := @AR@
RANLIB := @RANLIB@
INSTALL := @INSTALL@
AUTOCONF := @AUTOCONF@

#
# Build parameters.
#

CPPFLAGS := @CPPFLAGS@
CFLAGS := @CFLAGS@ 
A_CFLAGS := $(CFLAGS) 
S_CFLAGS := $(CFLAGS) -fPIC -DPIC
ifeq (macho, @abi@)
S_CFLAGS += -dynamic
endif
LDFLAGS := @LDFLAGS@ 

prefix := @PREFIX@
bindir := @BINDIR@
datadir := @DATADIR@
libdir := @LIBDIR@
includedir := @INCLUDEDIR@
mandir := @MANDIR@

PREFIX := $(prefix)
BINDIR := $(bindir)
DATADIR := $(datadir)
LIBDIR := $(libdir)
INCLUDEDIR := $(includedir)
MANDIR := $(mandir)

dir_names := lib src

all : $(dir_names:%=%_all)

install : $(dir_names:%=%_install)

uninstall : $(dir_names:%=%_uninstall)

clean : $(dir_names:%=%_clean)

distclean : clean $(dir_names:%=%_distclean)
	rm -f @objroot@config.log
	rm -f @objroot@config.status
	rm -f @objroot@cfghdrs.stamp
	rm -f @objroot@cfgoutputs.stamp
	rm -f @objroot@configure.lineno
	rm -f @cfghdrs@
	rm -f @cfgoutputs@
	rm -rf @objroot@autom4te.cache

relclean : distclean
	rm -f @objroot@configure

# Include Makefile.inc files in subdirectories.
include $(dir_names:%=%/Makefile.inc)

#
# Re-configuration rules.
#
ifeq (@enable_autogen@, 1)
@srcroot@configure : @srcroot@configure.ac
	cd ./@srcroot@ && $(AUTOCONF)

@objroot@config.status : @srcroot@configure
	./@objroot@config.status --recheck

# cfghdrs rules.
@srcroot@cfghdrs.stamp.in : @srcroot@configure.ac
	echo stamp > @srcroot@cfghdrs.stamp.in

$(patsubst %, @srcroot@%.in, @cfghdrs@) : @objroot@config.status

@objroot@cfghdrs.stamp : $(patsubst %, @srcroot@%.in, @cfghdrs@)
	./@objroot@config.status
	echo stamp > $@

$(filter-out @objroot@cfghdrs.stamp, @cfghdrs@) : @objroot@cfghdrs.stamp

# cfgoutputs rules.
@srcroot@cfgoutputs.stamp.in : @srcroot@configure.ac
	echo stamp > @srcroot@cfgoutputs.stamp.in

$(patsubst %, @srcroot@%.in, @cfgoutputs@) : @objroot@config.status

@objroot@cfgoutputs.stamp : $(patsubst %, @srcroot@%.in, @cfgoutputs@)
	./@objroot@config.status

$(filter-out \
	@objroot@cfgoutputs.stamp, \
	$(patsubst %, @objroot@%, @cfgoutputs@)) : @objroot@cfgoutputs.stamp
endif
